package cn.jhc.survey.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.servlet.http.HttpServletRequest;

@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello() {
        return "Hello web!";
    }
    
    @PostMapping("/submit.do")
    public String handle(HttpServletRequest request) {
        String name = request.getParameter("name");
        String age = request.getParameter("age");

        return name + "," + age;
    }
}
